#pragma once 
#ifndef __SWIG__
#include <windows.h>
#endif

#ifdef __SWIG__
%feature("ref")   CRefCount "$this->AddRef();"
%feature("unref") CRefCount "$this->Release();"
#endif 


class CRefCount
{
protected:
	ULONG m_nRef;
public:
	CRefCount() ;
	virtual ~CRefCount();
	unsigned long AddRef();
	unsigned long Release();
};

class CCritSec {
	// make copy constructor and assignment operator inaccessible
	CCritSec(const CCritSec &refCritSec);
	CCritSec &operator=(const CCritSec &refCritSec);
	CRITICAL_SECTION m_CritSec;
public:
	CCritSec();
	~CCritSec();
	void Lock();
	void Unlock();
};

class CAutoLock {
	// make copy constructor and assignment operator inaccessible
	CAutoLock(const CAutoLock &refAutoLock);
	CAutoLock &operator=(const CAutoLock &refAutoLock);

protected:
	CCritSec * m_pLock;

public:
	CAutoLock(CCritSec * plock);
	~CAutoLock();
};

